import requests


class ZuoYe:
    @classmethod
    def test_ysy4(cls, token, body):
        ysy4_url = "http://ihrm2-test.itheima.net/api/company/department"
        ysy4_header = {"Content-Type": "application/json", "Authorization": token}
        ysy4_reps = requests.post(url=ysy4_url, headers=ysy4_header, json=body)
        return ysy4_reps

    @classmethod
    def test_ysy3(cls, emp_id, token):
        ysy3_utl = "http://ihrm2-test.itheima.net/api/company/department/" + emp_id
        ysy3_header = {"Authorization": token}
        ysy3_reps = requests.get(url=ysy3_utl, headers=ysy3_header)
        return ysy3_reps

    @classmethod
    def test_ysy5(cls, emp_id, token, body):
        ysy4_url = "http://ihrm2-test.itheima.net/api/company/department/"+emp_id
        ysy4_header = {"Content-Type": "application/json", "Authorization": token}
        ysy4_reps = requests.put(url=ysy4_url, headers=ysy4_header, json=body)
        return ysy4_reps

    @classmethod
    def test_ysy6(cls, emp_id, token):
        ysy4_url = "http://ihrm2-test.itheima.net/api/company/department/"+emp_id
        ysy4_header = {"Authorization": token}
        ysy4_reps = requests.delete(url=ysy4_url, headers=ysy4_header)
        return ysy4_reps